#!/usr/bin/env python3.8
# -*- coding: utf-8 -*-
# @Author     : lime
# @Description: 定义配置信息
import pandas as pd
import os


abs_path_mulu = os.path.abspath('.')  # 当前py文件所在的绝对目录
abs_path_canshu_file = os.path.join(abs_path_mulu, "config")  #config 是连接配置信息参数


def read_canshu_data(txt_file):
    dict_data = {}  # 先定义一个字典用来存放要从txt中读取出来的数据
    with open(txt_file, 'r') as df:
        for line in df:
            # print(line)
            # if line.count('\n') == len(line):
            #     continue
            for kv in [line.strip().split('=')]:
                dict_data.setdefault(kv[0], []).append(kv[1])
    columns_name = list(dict_data.keys())
    dict_data_frame = pd.DataFrame(dict_data, columns=columns_name)
    return dict_data_frame


